package com.order.manager.service.impl;

import com.alibaba.fastjson2.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageInfo;
import com.github.pagehelper.page.PageMethod;
import com.order.manager.Model.SenderExamineInfo;
import com.order.manager.Model.SenderInfo;
import com.order.manager.mapper.SenderInfoMapper;
import com.order.manager.service.SenderInfoService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 24862
 * @description 针对表【sender_info】的数据库操作Service实现
 * @createDate 2024-04-08 15:32:30
 */
@Service
public class SenderInfoServiceImpl extends ServiceImpl<SenderInfoMapper, SenderInfo>
        implements SenderInfoService {

    @Resource
    SenderInfoMapper senderInfoMapper;

    @Resource
    SenderExamineInfoServiceImpl senderExamineInfoService;

    @Resource
    UserInfoServiceImpl userInfoService;

    @Override
    public PageInfo<SenderInfo> queryBySchool(int page, int item) {
        PageMethod.startPage(page, item);
        List<SenderInfo> senderInfos = senderInfoMapper.selectList(null);
        for (SenderInfo sender :
                senderInfos) {
                sender.setUserId(JSON.toJSONString(userInfoService.getById(sender.getUserId())));
        }
        return new PageInfo<>(senderInfos);
    }
}




